<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.List"%>
<%@ page import="cm.app.user.form.UserForm"%>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld"%>
<%
	UserForm form = (UserForm) request.getAttribute("form");
	String chkValue = form.getChkValue();
%>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>c2ms</title>
<script src="<%=request.getContextPath() %>/js/prototype.js"></script>
<script>
	
	function invoke(form, eventName, container) {
		var params = Form.serialize(form, {submit:eventName});
		params["ajaxFlag"] = true;
		params["pageNo"] = "0";
		new Ajax.Updater(container, form.action, {method:'post', parameters:params, onSuccess:scc});
	}
	
	function invoke_page(form, eventName, container, flag) {
		var params = Form.serialize(form, {submit:eventName});
		params["turnPageFlag"] = flag;
		new Ajax.Updater(container, form.action, {method:'post', parameters:params, onSuccess:scc});
	}
	
	function invoke_delete(form, eventName, container, deleteLoginId) {
		var params = Form.serialize(form, {submit:eventName});
		params["ajaxFlag"] = true;
		params["deleteLoginId"] = deleteLoginId;
		new Ajax.Updater(container, form.action, {method:'post', parameters:params, onSuccess:scc});
	}
	
	function scc(originalRequest) {
		var flag = originalRequest.responseText;
		if(flag == "false") {
			new Ajax.Updater("userForm", "<%=request.getContextPath()%>/jsp/exception/error.jsp");
		}
	}

</script>
</head>
<body>
<form action="User.action" id="userForm" name="userForm"  method="post" onsubmit="return false;">
	<div id="testDiv2"></div>
	<span>検索条件</span>
	<table style="border-collapse: collapse; border: 1px solid #000000;" align="center" width="75%">
		<tr bgcolor="#d4d0c8">
			<td align="center" style="border: 1px solid #000000;">LOGIN ID</td>
			<td align="center" style="border: 1px solid #000000;">NAME</td>
			<td align="center" style="border: 1px solid #000000;">ORGANIZATION ID</td>
			<td align="center" style="border: 1px solid #000000;" nowrap="nowrap">ORGANIZATION NAME</td>
			<td align="center" style="border: 1px solid #000000;" nowrap="nowrap">全部検索</td>
			<td align="center" rowspan="2" style="border: 1px solid #000000;">
				<input type="submit" name="search" value="Search" onclick="invoke(this.form, this.name, 'userInfoDiv');">
			</td>
		</tr>
		<tr>
			<td align="center" style="border: 1px solid #000000;"><input type="text" id="loginId" name="loginId" value="<%=form.getLoginId() %>" /></td>
			<td align="center" style="border: 1px solid #000000;"><input type="text" id="name" name="name" value="<%=form.getName() %>" /></td>
			<td align="center" style="border: 1px solid #000000;"><input type="text" id="loginId" name="organizationId" value="<%=form.getOrganizationId() %>" /></td>
			<td align="center" style="border: 1px solid #000000;"><input type="text" id="loginId" name="organizationName" value="<%=form.getOrganizationName() %>"/></td>
			<td align="center" style="border: 1px solid #000000;"><input type="checkbox" id="chkValue" name="chkValue" value="1" <%if("1".equals(chkValue)){ %> checked <%} %> /></td>
		</tr>
	</table>
	<br>
	<div id="userInfoDiv"></div>
</form>
</body>
</html>